<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.shsh.safemanage.dao.EquipmentDao"%>
<%@page import="com.shsh.safemanage.model.Equipment"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.DepartmentDao"%>
<%@page import="com.shsh.safemanage.model.Department1"%>

<%
DepartmentDao departmentDao = DaoCreator.createDepartmentDao();
EquipmentDao equipmentDao = DaoCreator.createEquipmentDao();
%>
<div class="hider" id="hider">
	<span>&nbsp;</span>
</div>
<div class="position">
	<img src="images/position2.jpg" style="padding: 7px 9px; float: left;" />当前位置：中国石化安全问题管理平台 &gt;&gt; 问题浏览
</div>
<div class="tt">问题浏览</div>
<div class="content">
	<table align="center" border="1" width="99%" cellpadding="0"
		cellspacing="0">
		<tr>
			<td class="td1">
				<%
				List<Department1> departList = departmentDao.getDepartment1List(2);
				%>
				<span style="margin-left: 30px">作业部（业务中心）:</span>
				<select id="departmentID">
					<option value="">-请选择-</option>
					<%
					for (Department1 depart1 : departList) {
					%>
					<option value="<%=depart1.getId()%>"><%=depart1.getDepartmentName()%></option>
					<%
					}
					%>
				</select>
				
				<br />
				<%
				List<Equipment> equipList = equipmentDao.getEquipmentList();
				%>
				<span style="margin-left: 30px">装置：</span>
				<select id="equipID">
					<option value="">-请选择-</option>
				<%
				for (Equipment equip : equipList) {
				%>
					<option value="<%=equip.getId()%>"><%=equip.getEquipName()%></option>
				<%
				}
				%>
				</select>
				
				<br />
				<span style="margin-left: 30px">问题标题：</span>
				<input type="text" size="15" id="problemTitle" />
				<span style="margin-left: 10px">全文：</span>
				<input type="text" size="30" id="problemContent" />
				
				<br />
				<span style="margin-left: 30px">填报日期区间：</span>
				<input type="text" id="dateStart" size="15" />-<input type="text" id="dateEnd" size="15" />
				
				<input type="button" value="浏 览" onclick="browseProblems()" />
			</td>
		</tr>
		<tr>
			<td class="td1" id="problemBrowseListTD">
				<%@include file="problem_list.jsp" %>
			</td>
		</tr>
	</table>
</div>

<script type="text/javascript">
function browseProblems() {
	openWaitingDialog('waitingDialog');
	loadPageSection('/safe_manage/problem_list.jsp', 'problemBrowseListTD', {
		departmentID: getElementValueByID('departmentID'),
		equipID: getElementValueByID('equipID'),
		problemTitle: getElementValueByID('problemTitle'),
		problemContent: getElementValueByID('problemContent'),
		dateStart: getElementValueByID('dateStart'),
		dateEnd: getElementValueByID('dateEnd')
	});
}

$(document).ready(function() {
	$('#dateStart').datepicker({
		dateFormat: 'yy-mm-dd',
		monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
		showButtonPanel:true,
        clearText:"清除",   
        closeText:"关闭",
        prevText: '上月',  
        nextText: '下月'
	});
	$('#dateEnd').datepicker({
		dateFormat: 'yy-mm-dd',
		monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
		showButtonPanel:true,
        clearText:"清除",   
        closeText:"关闭",
        prevText: '上月',  
        nextText: '下月'
	});
});
</script> 
